<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>vue</title>
    <style type="text/css">
      .bg {
        background: #f00;
      }
    </style>
  </head>
  <script src="../vue-2.6.11.js"></script>
  <body>
    <!-- 模板 -->
    <div id="demo"></div>

    <script>
      //数据
      let data = {
        message: 'abcdef',
        addClass: true
      }

      //vm实例
      let vm = new Vue({
        el: '#demo', //挂载元素
        data: data,
        render(createElement) {
          //返回VNode对象
          var obj = createElement(
            'ul',
            {
              class: {
                bg: true
              },
              style: {
                fontSize: '50px'
              },
              attrs: {
                abc: 'miaov'
              },
              domProps: {
                innerHTML: '<li>我是HTML</li>'
              }
            },
            [
              createElement('li', 1),
              createElement('li', 2),
              createElement('li', 3)
            ]
          )
          console.log(obj)
          return obj
        }
      })
    </script>
  </body>
</html>
